import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:search_people/utils/component/selection/model.dart';
import 'package:search_people/value/topcolors.dart';

import '../index.dart';

/// hello
class SelectionAreaWidget extends GetView<SelectionController> {
  const SelectionAreaWidget({
    Key? key,
    required this.md,
    this.onTap,
  }) : super(key: key);
  final SelectionModel md;
  final Function()? onTap;
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Container(
        height: 50.r,
        alignment: Alignment.centerLeft,
        decoration: BoxDecoration(
          border: Border(
            left: md.isSelected
                ? BorderSide(
                    color: TopColors.main_color,
                    width: 5.r,
                  )
                : BorderSide.none,
          ),
          color: md.isSelected ? Colors.white : TopColors.gray_f3,
        ),
        child: Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
          Text(
            md.title,
            style: TextStyle(
              color: TopColors.black_33,
              fontSize: 15.sp,
            ),
          ),
          Visibility(
            visible: md.result != null,
            child: Container(
              width: 6.r,
              height: 6.r,
              decoration: BoxDecoration(
                  color: TopColors.main_color,
                  borderRadius: BorderRadius.circular(3.r)),
            ),
          )
        ]),
      ),
    );
  }
}
